import React, { Component, lazy, Suspense } from 'react';
import { NavBar, Toast, Form, Input, Button } from 'antd-mobile'
import { Redirect, Switch, Route, } from 'react-router-dom'
var Reg1 = lazy(() => import('./Reg1'))
var Reg2 = lazy(() => import('./Reg2'))
var Reg3 = lazy(() => import('./Reg3'))
var Loading = lazy(() => import('../Loading'))
var NotFound=lazy(()=>import('../NotFound'))
class Register extends Component<any, any> {
    back() {
        // console.log(this.props);
        this.props.history.go(-1)
    }
    render() {
        return (
            <div className='register'>
                <header>
                    <NavBar onBack={() => { this.back() }}>注册页</NavBar>
                </header>
                <Suspense fallback={<Loading />}>
                    <Switch>
                        <Route exact path='/register/reg1' >
                            <Reg1/>
                        </Route>
                        <Route exact path='/register/reg2' >
                            <Reg2/>
                        </Route>
                        <Route exact path='/register/reg3' >
                            <Reg3/>
                        </Route>
                        <Redirect exact from='/register' to='/register/reg1'/>
                        <Route  path='*' >
                            <NotFound/>
                        </Route>
                    </Switch>
                </Suspense>
            </div>
        );
    }
}

export default Register;